/*软件延时函数*/
void Delay(volatile int delay)
{
	while(delay --);
}
/*主函数*/
int main(void)
{
	/*定义指针指向寄存器地址*/
	unsigned int *pGPFCON	= (unsigned int *)0x56000050;
	unsigned int *pGPFDATA	= (unsigned int *)0x56000054;
	int val = 0;
	int tmp = 0;
	unsigned long gpf0 = 0,gpf2 = 0;
	
	/*led引脚配置*/
	*pGPFCON &= ~((3 << 8) | (3 << 10) | (3 << 12));	//清零
	*pGPFCON |= ((1 << 8) | (1 << 10) | (1 << 12));
	/*key引脚配置*/
	*pGPFCON &= ~((3 << 0) | (3 << 4));					//清零
	/*循环点亮*/
	while(1)
	{
		gpf0 = *pGPFDATA;
		gpf2 = *pGPFDATA;

		*pGPFDATA |= (1 << 6);
		*pGPFDATA |= (1 << 5);
		Delay(1000000);
		*pGPFDATA &= ~(1 << 6);
		*pGPFDATA &= ~(1 << 5);
		Delay(1000000);
	}
}
